package com.example.demo.util;

import com.example.demo.entity.TUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author 何景航
 * @date 2025/3/7 16:14
 */
public class LoginInfoUtil {
    public static TUser getCurrentLoginUser(){
        return (TUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
